#ifndef __FPSCtrl_H__
#define __FPSCtrl_H__

#include "../Header/Header.h"

#define DEFAULT_LIMIT_FPS 60
class FPSController
{
private:
	__UINT32 m_iStartTime;
protected:
	static FPSController* m_pInstance;
	__UINT32 m_iLimitFPS;
	__UINT32 m_iLimitFrame;
	__UINT32 m_iFrame;
protected:
	FPSController();
public:
	virtual ~FPSController();
	static FPSController* GetInstance()
	{
		if (!m_pInstance)
		{
			m_pInstance = new FPSController();
		}
		return m_pInstance;
	}
	virtual __VOID SetLimitFPS(__UINT32 limitFPS);
	virtual __VOID StartCounter();
	virtual __VOID EndCounter();
	virtual __UINT32 GetFrame(){ return m_iFrame; }
	virtual __FLOAT GetRuntimeFPS(){ return (m_iFrame) ? (1000.0f / m_iFrame) : 0; }
};

#endif